<?php

// +----------------------------------------------------------------------
// | MyCentOS
// +----------------------------------------------------------------------
// | Copyright (c) 2014 http://www.mycentos.com, All rights reserved.
// +----------------------------------------------------------------------
// | Author: 琥珀 <317559272@qqq.com><http://www.mycentos.com>
// +----------------------------------------------------------------------
// | @date  : 2015-04-20 17:50:27
// +----------------------------------------------------------------------
// | @Last Modified by:  琥珀
// +----------------------------------------------------------------------
// | @Last Modified time: 2015-04-21 14:53:52
// +-----------------------------------------------------------------------


namespace Home\Widget;
use Think\Controller;

/**
 * 最新文章widget
 * 用于动态调用最新文章信息
 */

class ArticleWidget extends Controller{
    //获取最新文章
    public function index($firstnum = 0,$lastnum = 5){
        $list = M('Article');
        $data = $list->limit($firstnum,$lastnum)->select();
        $this->assign('newarticle',$data);
        $this->display('Widget/lists');
    }

}
